import views as views
from django.shortcuts import render
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.views import View

# Create your views here.

def my_decorator(func):
    def wapper(request,*args,**kwargs):
        print('给添加装饰器')
        return func(request,*args,**kwargs)

    return wapper

@method_decorator(my_decorator,name='get')
class LoginView(View):

    def get(self,request):
        return HttpResponse('get请求')

    def post(self,request):
        return HttpResponse('post请求')

    def put(self,request):
        return HttpResponse('put请求')

    def delete(self,request):
        return HttpResponse('delete请求')

def login(request):
    return HttpResponse('hello')